//
//  HBHtradingAreaCell.m
//  HubeiHotel
//
//  Created by 张露杰 on 18/4/10.
//  Copyright © 2018年 张露杰. All rights reserved.
//

#import "HBHtradingAreaCell.h"

@implementation HBHtradingAreaCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    //    继承父类
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
    }
    return self;
}

-(void)loadCellWithData:(NSDictionary *)data isSelect:(BOOL)isSelect
{
    //    重新布局
    for (UIView *view in self.contentView.subviews) {
        [view removeFromSuperview];
    }
    
    UILabel *label = [TomamaUI createLabel:CGRectMake(25*screenW_6, 0, SCREENW - 125*screenW_6, 14*screenW_6) textAligment:0 font:[UIFont systemFontOfSize:14*screenW_6] textColor:TextBlack text:data[@"name"]];
    [self.contentView addSubview:label];
    label.center = CGPointMake(label.center.x, 20*screenW_6);
    
    UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(25*screenW_6, 40*screenW_6 - 1, SCREENW - 125*screenW_6, 1)];
    lineView.backgroundColor = LineColor;
    [self.contentView addSubview:lineView];
    
    if (isSelect) {
        label.textColor = mainColor;
        
        UIImageView *imageV = [TomamaUI createImageView:CGRectMake(SCREENW - 145*screenW_6, 0, 12.5*screenW_6, 8.5*screenW_6) backGroundImageV:@"hotel_select"];
        [self.contentView addSubview:imageV];
        imageV.center = CGPointMake(imageV.center.x, label.center.y);
    }
}

@end
